package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: AlarmService
 * @Date: Created in 14:01 2021/6/17
 * @Description: 报警
 */
@Service
public class AlarmService extends BaseService {

    /**
     * @Author YangYu
     * @Description 报警日志分页列表
     * @Date Created in 13:54 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity alarmLogPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","alarmLogPagList","alarm");
    }

    /**
     * @Author YangYu
     * @Description 报警日志列表(前5条)
     * @Date Created in 13:54 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity alarmLogList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","alarmLogList","alarm");
    }

    /**
     * @Author YangYu
     * @Description 前端是否对这个用户做报警处理
     * @Date Created in 13:54 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity isAlarm(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","isAlarm","alarm");
    }
}
